<?php
namespace app\admin\controller\v1;
use app\admin\Adminbase;

class Lottery extends Adminbase 
{
	
	/**
	* 获取活动地址
	* /admin/v1/Lottery/getUrl
	* 不需要登录 
	* @is_need_login true
	*/
	public function getUrl($id){
		try {
			$url = 	config('web_domain')."/index.php/page?url=pages/lottery/index";
			$url = $url."&activity_id=".$id;
			return $this->ReSucess($url);	
		} catch (Exception $e) {
			throw new \think\Exception( $e );
		}
	}
	
	/**
	* 清空中奖日志
	* /admin/v1/Lottery/emptyLog
	* 不需要登录 
	* @is_need_login true
	*/
	public function emptyLog($id){
		try {
			model('LotteryGetUser')->where('activity_id',$id)->delete();
			model('LotteryUserShareNum')->where('activity_id',$id)->delete();
			return $this->ReSucess();	
		} catch (Exception $e) {
			throw new \think\Exception( $e );
		}
	}
	
}



